package cn.wolfcode.luowowo.common.util;

import cn.wolfcode.luowowo.common.exception.LogicException;

/**
 * 断言工具类
 */
public class AssertUtil {

    //判断是否为空
    public static void hasLength(String data,String msg) {
        if(data == null || "".equals(data.trim())){
            throw new LogicException(msg);
        }
    }

    //判断是否一致
    public static void hasEquals(String data1, String data2,String msg) {
        if((data1 == null || "".equals(data1.trim())) || (data2 == null || "".equals(data2.trim()))){
            throw new LogicException("密码参数不能为空");
        }

        if (!data1.equals(data2)){
            throw new LogicException(msg);
        }
    }


}
